1. If a movie file has a color table, how can we access it (at or before preDecompress)?
2. Can QuickTime for Windows use the exact color table of a movie in the currently realized (Windows) palette? If so, can it still do this if I decompress into raw format?
3. If I am trying to decompress to a Windows bitmap (i.e., I specify OPT_BMP in the 'optt' field during preDecompress), what should the format of the lpUncompressed buffer be? Does lpUncompressed contain the bitmap header and the color table as well as the bits?
4. Is it possible to debug a QuickTime for Windows decompressor while running
the QuickTime for Windows Movie Player (as you can debug DLL's in 16-bit
Windows)?
A Movie Color Tables (Questions 1 and 2).
QuickTime for Windows 2.0 introduced the feature of making use of the 'clut' movie color-table entry (this is stored by the QuickTime 2.0 SetMovieColorTable function on the Mac, and it is used by various QuickTime tools to create and set palette information). Before QuickTime for Windows 2.0, there was no direct solution for color-table handling with QuickTime for Windows.
QuickTime for Windows 2.0.x does not have a direct function for retrieving the palette (style GetMovieColorTable on the Mac), but this function will be added to later QuickTime for Windows releases. However, you can retrieve the palette by first issuing a GetMoviePict to retrieve a PictHandle, and then issuing a GetPicturePalette to retrieve the HPALETTE from the PictHandle. When you have access to the stored palette, you can use it for full control of the environment's palette management.
The following is information about default palette handling with the movie controller (i.e., when the flag mcFlagsUseWindowPalette is enabled):
The palette from the movie is asserted as the clut when the movie opens (i.e., this clut is set as the system palette). Therefore, it is important to reserve 20 entries (first 10, last 10) of the 256 available for the Windows system palette. Tools such as DeBabelizer usually are capable of creating palettes that can work across platforms.
QuickTime for Windows dithers against the system palette, and since it can determine when the system palette has changed, it adjusts the dithering dynamically (QuickTime for Windows inherits any new system palettes). Note that all codecs in an 8-bit environment have their movie frames dithered using this scheme. This means that only the system palette is changed, not the logical palette, and the palette is realized as a foreground-only palette.
If two or more QuickTime for Windows movie files are loaded, the last movie's color table will always take precedence. If you want to change this behavior, you can retrieve the palette information from the movie and override this behavior based on your palette-management scheme.
3. The capability definition must state explicitly that your codec supports OPT_BMP and other supported optimization options. For additional information regarding the CodecCapabilities data structure, see pages 4-35 to 4-39 of Inside Macintosh: QuickTime Components on the QuickTime 2.0 SDK.
4. As long as the entry point if known, you can use Soft-ICE from NuMega
technologies, or a similar low/high level debugger.